<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/8/8
 * Time: 12:01
 */

namespace app\common\entity;


use app\admin\service\rbac\Users\Service;
use think\Model;

class AdminRegLog extends Model
{
    /**
     * @var string 对应的数据表名
     */
    protected $table = 'admin_reg_log';

    public function addLog($user_id,$money_type,$num,$remark)
    {
        $model = new self();
        $name = (new Service())->getAdminName();
        $model->admin_name = $name;
        $model->user_id = $user_id;
        $model->money_type = $money_type;
        $model->num = $num;
        $model->remark = $remark;
        $model->create_time = time();
        $res = $model->save();
        if ($res){
            return true;
        }
        return false;
    }
}